# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required, permission_required
from . import views

urlpatterns = [
    url(r'^$', views.HomeView.as_view(), name='home'),
    url(r'^create$', login_required(
        views.CreateMessageView.as_view()), name='create'),
    #url(r'^create$', views.CreateMessageView2.as_view(), name='create'),
    url(r'^public_timeline$', views.PublicTimelineView.as_view(),
        name='public_timeline'),
    url(r'^private_timeline$', views.PrivateTimelineView.as_view(),
        name='private_timeline'),
    url(r'^user/(?P<username>[-\w@.]+)/$',
        views.UserDetailView.as_view(), name='user_detail'),
    url(r'^user/(?P<username>[-\w@.]+)/follow/$',
        login_required(views.FollowView.as_view()), name='user_follow'),
    url(r'^user/(?P<username>[-\w@.]+)/unfollow/$',
        login_required(views.UnFollowView.as_view()), name='user_unfollow'),
    url(r'^following/$', login_required(views.FollowingListView.as_view()),
        name='following'),
    url(r'^follower/$', login_required(views.FollowerListView.as_view()),
        name='followers'),
    url(r'^user/$', login_required(views.UserListView.as_view()), name='user_list'),
]
